/*
 * @Author: ZhanXie
 * @Date: 2020-08-11 11:26:40
 * @LastEditors: ZhanXie
 * @LastEditTime: 2020-08-13 16:05:32
 * @Description: 存储配置
 * @FilePath: /weibo/src/conf/db.js
 */

const { isProd } = require('../utils/env')

let MYSQL_CONF = {
  host: '127.0.0.1',
  user: 'root',
  password: 'Z61524334251',
  port: 3306,
  database: 'weibo_db',
  dialect: 'mysql',
}

let REDIS_CONF = {
  port: 6379,
  host: '127.0.0.1'
}

if (isProd) {

  // 线上环境配置
  REDIS_CONF = {
    port: 6379,
    host: '127.0.0.1'
  }

  MYSQL_CONF = {
    host: '127.0.0.1',
    user: 'root',
    password: 'Z61524334251',
    port: 3306,
    database: 'weibo_db'
  }
}

module.exports = {
  REDIS_CONF,
  MYSQL_CONF
}